package com.mdd.front.controller;

import com.mdd.common.utils.ConfigUtil;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 网站信息配置管理
 */
@RestController("settingWebsiteController")
@RequestMapping("api/setting/website")
public class WebsiteController {

    /**
     * 获取地图的配置
     *
     * @param
     * @return Object
     * @author fzr
     */
    @GetMapping("/getMapKey")
    public Map<String, String> getMapKey() {
        Map<String, String> mapKey = ConfigUtil.get("website_map_key");
        return mapKey;
    }

    /**
     * 设置地图的配置
     *
     * @param
     * @return Object
     * @author fzr
     */
    @PostMapping("/setMapKey")
    public void setMapKey(@RequestBody Map<String, String> params) {
        for (Map.Entry<String, String> entry : params.entrySet()) {
            ConfigUtil.set("website_map_key", entry.getKey(), entry.getValue());
        }
    }
}
